const state = {
  list: [], // 播放历史
  music: {}, // 当前播放歌曲
  lists: [] // 页面显示歌曲列表
}

const mutations = {
  copyLists (state, list) {
    state.lists = list
  },
  select (state, obj) {
    state.music = obj
    state.list.push(obj)
  },
  add (state, obj) {
    state.list.push(obj)
  },
  clear (state) {
    state.list = []
  }
}

export default {
  namespaced: true,
  state,
  mutations
}
